<?php
require_once 'class/DataIn/AbstractDataIN.php';
require_once 'class/DataIn/AbstractDataIN.php';
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Time
 *
 * @author mateusz.ledzewicz
 */
class Time extends AbstractDataIN{
    
    protected function prepareData() {
      
        $data = $this->get->getArray();
        foreach($data as $line){
            if(!isSet($line[AbstractGet::$mapper['date']]))
                continue;
           
            $dateBeging = new DateTime(Constants::dateFrom);
            $dateTemp   = new DateTime($line[AbstractGet::$mapper['date']]);
            $interval = $dateTemp->diff($dateBeging);
            $this->data[] = (int) $interval->format('%R%a');
        }
    }
}

?>
